<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0">
    <title>Document</title>
    <style>
        input{
            width: 200px;
            transform: all 1s;
        }
        input:focus{
            width: 500px;
        }
    </style>
</head>
<body>
    <input type="text">
    <!--<input type="password"> -->
    <script>
        //const input1=document.querySelector('type=text')
        //const input2=document.querySelector('type=password')
        //input1.addEventListener('keydown',function(){
          //  console.log('键盘按下了')
        //})
        //input2.addEventListener('keyup',function(){
          //  console.log('键盘弹起了')
        //})
        const input = document.querySelector('input')
        input.addEventListener('input',function(){
            //console.log('555')
            console.log(ipt.value.length)
        })
    </script>
</body>
</html>